﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ThridGroup.ERP.DTO.WarehouseManagement;
using Volo.Abp.Application.Services;

namespace ThridGroup.ERP.WarehouseManagement
{
    /// <summary>
    /// 装箱查询结果
    /// </summary>
    public class PackingQueryResult
    {
        /// <summary>
        /// 数据列表
        /// </summary>
        public List<QueryPackingDto> Data { get; set; } = new List<QueryPackingDto>();
        
        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }
    }

    /// <summary>
    /// 装箱管理接口
    /// </summary>
    public interface IPackingServices : IApplicationService
    {
        /// <summary>
        /// 添加装箱
        /// </summary>
        /// <param name="dto">装箱信息</param>
        /// <returns></returns>
        Task<int> CreatePacking(QueryPackingDto dto);

        /// <summary>
        /// 查询装箱（分页/条件）
        /// </summary>
        /// <param name="dto">查询条件</param>
        /// <returns></returns>
        Task<PackingQueryResult> QueryPacking(GetPackingDto dto);

        /// <summary>
        /// 修改装箱
        /// </summary>
        /// <param name="dto">装箱信息</param>
        /// <returns></returns>
        Task<int> UpdatePacking(QueryPackingDto dto);

        /// <summary>
        /// 批量删除装箱
        /// </summary>
        /// <param name="ids">装箱ID列表</param>
        /// <returns></returns>
        Task BatchDeletePacking(List<int> ids);

        /// <summary>
        /// 根据ID获取装箱信息
        /// </summary>
        /// <param name="id">装箱ID</param>
        /// <returns></returns>
        Task<QueryPackingDto> GetPackingById(int id);

        /// <summary>
        /// 根据ID获取装箱信息修改状态
        /// </summary>
        /// <param name="id">装箱ID</param>
        /// <returns></returns>
        Task<int> GetPackingStatus(int id);


        /// <summary>
        /// 添加装箱明细
        /// </summary>
        /// <returns></returns>
        Task<int> AddPackingDetailsModelS(PackingDetailsModelDto packingDetailsModelDto);

        /// <summary>
        /// 分页查询装箱明细
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        Task<List<PackingDetailsModelDto>> QueryPackingDetailsModel(string PackingCode, int page = 1, int limit = 3);

        /// <summary>
        /// 修改装箱明细
        /// </summary>
        /// <param name="dto">装箱明细信息</param>
        /// <returns></returns>
        Task<int> UpdatePackingDetailsModel(PackingDetailsModelDto dto);

        /// <summary>
        /// 批量删除装箱明细
        /// </summary>
        /// <param name="ids">装箱明细ID列表</param>
        /// <returns></returns>
        Task<int> BatchDeletePackingDetailsModel(List<int> ids);
    }
}
